//**************************************//
//                                      //
//                                      //
//**************************************//
#ifndef __vertex__
#define __vertex__

#include "mPoint.h"
#include <vector>
#include <cmath>
#include <GL/gl.h>

//vertex objects
struct vertex
{
    float x,y,z;
    float r,g,b,a;
    float nx,ny,nz;
    float id_r,id_g,id_b,id_a;
    float tx,ty;
};

//*************************
//**
//*************************
class DrawBuffer
{
private:
    bool world;
    unsigned int shader;                 //Shader number to use
    GLuint type;                 //OpenGL type GL_POINT etc....

public:
    std::vector<vertex> vbuf;    //vertex data
    DrawBuffer(){};

    void Set(GLuint Type,unsigned int shade,bool W)
    {
        world=W;
        shader=shade;
        type=Type;
    };
    GLuint Type(){return type;}
    bool InWorld(){return world;}
    unsigned int useShader(){return shader;}

    void Clear();
    void VTex(mPoint P,unsigned int ID,float tx,float ty);
    void Vert(mPoint P,float R=0,float G=0,float B=0,float A=1,mPoint normal = mP(0,0,0),unsigned int ID = 0 , float tx=0, float ty=0 );
};


#endif
